package com.icim.entity;

import java.sql.Timestamp;

import com.icim.csot.importer.xmlentity.CsotSalesOrderXmlEntity;
import com.icim.util.TimeUtil;

public class Ret_cus_so {

    private String opeFabId;
    private String cusSoId;
    private String cusSoCate;
    private String cusSoStat;
    private String mdlIdFk;
    private String mtrlProdIdFk;
    private Integer plnPrdQty;
    private String cusSoGrade;
    private Timestamp plnStbTimestamp;
    private Timestamp plnCmpTimestamp;
    private Timestamp cusPoRlsTimestamp;
    private String crtUsr;
    private Timestamp crtTimestamp;
    private String cusSoNote;
    private String cusSoRemark;
    private String cusIdFk;
    //not belong to table;
    private String icimSoId;

    public String getOpeFabId() {
        return opeFabId;
    }

    public void setOpeFabId(String opeFabId) {
        this.opeFabId = opeFabId;
    }

    public String getCusSoId() {
        return cusSoId;
    }

    public void setCusSoId(String cusSoId) {
        this.cusSoId = cusSoId;
    }

    public String getCusSoCate() {
        return cusSoCate;
    }

    public void setCusSoCate(String cusSoCate) {
        this.cusSoCate = cusSoCate;
    }

    public String getCusSoStat() {
        return cusSoStat;
    }

    public void setCusSoStat(String cusSoStat) {
        this.cusSoStat = cusSoStat;
    }

    public String getMdlIdFk() {
        return mdlIdFk;
    }

    public void setMdlIdFk(String mdlIdFk) {
        this.mdlIdFk = mdlIdFk;
    }

    public String getMtrlProdIdFk() {
        return mtrlProdIdFk;
    }

    public void setMtrlProdIdFk(String mtrlProdIdFk) {
        this.mtrlProdIdFk = mtrlProdIdFk;
    }

    public Integer getPlnPrdQty() {
        return plnPrdQty;
    }

    public void setPlnPrdQty(Integer plnPrdQty) {
        this.plnPrdQty = plnPrdQty;
    }

    public String getCusSoGrade() {
        return cusSoGrade;
    }

    public void setCusSoGrade(String cusSoGrade) {
        this.cusSoGrade = cusSoGrade;
    }

    public Timestamp getPlnStbTimestamp() {
        return plnStbTimestamp;
    }

    public void setPlnStbTimestamp(Timestamp plnStbTimestamp) {
        this.plnStbTimestamp = plnStbTimestamp;
    }

    public Timestamp getPlnCmpTimestamp() {
        return plnCmpTimestamp;
    }

    public void setPlnCmpTimestamp(Timestamp plnCmpTimestamp) {
        this.plnCmpTimestamp = plnCmpTimestamp;
    }

    public Timestamp getCusPoRlsTimestamp() {
        return cusPoRlsTimestamp;
    }

    public void setCusPoRlsTimestamp(Timestamp cusPoRlsTimestamp) {
        this.cusPoRlsTimestamp = cusPoRlsTimestamp;
    }

    public String getCrtUsr() {
        return crtUsr;
    }

    public void setCrtUsr(String crtUsr) {
        this.crtUsr = crtUsr;
    }

    public Timestamp getCrtTimestamp() {
        return crtTimestamp;
    }

    public void setCrtTimestamp(Timestamp crtTimestamp) {
        this.crtTimestamp = crtTimestamp;
    }

    public String getCusSoNote() {
        return cusSoNote;
    }

    public void setCusSoNote(String cusSoNote) {
        this.cusSoNote = cusSoNote;
    }

    public String getCusSoRemark() {
        return cusSoRemark;
    }

    public void setCusSoRemark(String cusSoRemark) {
        this.cusSoRemark = cusSoRemark;
    }

    public String getCusIdFk() {
        return cusIdFk;
    }

    public void setCusIdFk(String cusIdFk) {
        this.cusIdFk = cusIdFk;
    }

    public boolean isValid() {
        return true;
    }
    
    

    public String getIcimSoId() {
        return icimSoId;
    }

    public void setIcimSoId(String icimSoId) {
        this.icimSoId = icimSoId;
    }

    public boolean CostSalesOrderXml2Entity(CsotSalesOrderXmlEntity xmlEntity) {
        this.setOpeFabId(xmlEntity.getFACTORYNAME());
        this.setCusSoId(xmlEntity.getWORKORDER());
        this.setCusSoCate(xmlEntity.getWOTYPE());
        this.setCusSoStat(xmlEntity.getSTATUS());
        this.setMdlIdFk(xmlEntity.getPRODUCTID());
        this.setMtrlProdIdFk(xmlEntity.getMODELNAME());
        this.setPlnPrdQty(xmlEntity.getORDERQTY());
        this.setCusSoGrade(xmlEntity.getGRADE());
        this.setPlnStbTimestamp(TimeUtil.String2Timestamp(xmlEntity.getPLANRELEASEDTIME()));
        this.setPlnCmpTimestamp(TimeUtil.String2Timestamp(xmlEntity.getPLANFINISHEDTIME()));
        this.setCusPoRlsTimestamp(TimeUtil.String2Timestamp(xmlEntity.getRELEASETIME()));
        this.setCrtUsr(xmlEntity.getCREATOR());
        this.setCrtTimestamp(TimeUtil.String2Timestamp(xmlEntity.getCREATIONTIME()));
        this.setCusSoNote(xmlEntity.getCOMMENT());
        this.setCusSoRemark(xmlEntity.getREMARK());
        return true;
    }
}
